* ============================================================================ *
* PROJECT:		International Naming and Shaming
* OBJECTIVE: 	Replication code for "Shame, Endorse or Remain Silent?: State Response to Human Rights Violations in Other Countries"
* AUTHOR: 		Omer Zarpli and Huseyin Zengin 
* DATE:			2021-12-03
* ============================================================================ *



use "ZZ_MainData"

*********************** Variables *******************
/*
country_name: country name
COWcode: COW country codes
defend_silent_shame: countries' response to China. -1 for defending, 0 for remaining silent, 1 for naming and shaming
agree_average: countries' agreement ratio with China at the UN
chinatradegdp: the ratio of a country's trade with China to its GDP
v2x_polyarchy: democracy score (polyarchy)
muslim_ratio: ratio of Muslim population in a country
turk: dummy variable for ethnic affinity. 1 for Turkic identity, 0 for otherwise
relativecinc: countries' relative capacity with respect to that of China
humanrights: human rights score
logpop: population (logged)
loggdp: GDP (logged)
relativegdp: countries' relative GDP with respect to that of China
position: same as defend_silent_shame. only exists in panel data
*/

*Table 1
mlogit  defend_silent_shame  agree_average chinatradegdp  v2x_polyarchy  muslim_ratio i.turk relativecinc humanrights logpop loggdp  if COWcode!=710, baseoutcome(0) vce(robust)
 
*Figure 4a
set scheme plottigblind

margins, at(chinatradegdp=(0(0.01)0.67))
marginsplot, level(90)
*Figure 4b
set scheme plotplainblind
margins, at(v2x_polyarchy=(0(0.05)0.90))
marginsplot, level(90) recastci(rarea)
 
 *Table 2
mlogit  defend_silent_shame  agree_average chinatradegdp  v2x_polyarchy i.turk muslim_ratio relativecinc humanrights logpop loggdp  if COWcode!=710, baseoutcome(0) vce(robust)

margins, dydx(agree_average) pr(outcome(-1))
margins, dydx(agree_average) pr(outcome(1))

margins, dydx(chinatradegdp) pr(outcome(-1))
margins, dydx(chinatradegdp) pr(outcome(1))

margins, dydx(v2x_polyarchy) pr(outcome(-1))
margins, dydx(v2x_polyarchy) pr(outcome(1))

margins, dydx(humanrights) pr(outcome(-1))
margins, dydx(humanrights) pr(outcome(1))

margins, dydx(turk) pr(outcome(-1))
margins, dydx(turk) pr(outcome(1))

margins, dydx(muslim_ratio) pr(outcome(-1))
margins, dydx(muslim_ratio) pr(outcome(1))

*Table A1 (Appendix) Descriptive Statistics
summarize agree_average chinatradegdp v2x_polyarchy humanrights turk muslim_ratio relativecinc logpop loggdp if COWcode!=710

*Table A2 (Appendix) Correlation Table
corr agree_average chinatradegdp v2x_polyarchy humanrights turk muslim_ratio relativecinc logpop loggdp if COWcode!=710

*Table A3 (Appendix) Determinants of Inter-State Shaming: Interaction Effect of Democracy and Identity
mlogit  defend_silent_shame  agree_average chinatradegdp  c.v2x_polyarchy##c.muslim_ratio turk relativecinc humanrights logpop loggdp  if COWcode!=710, baseoutcome(0) vce(robust)




****************** Online Appendix	***********************

*Using relative income level (GDP) instead of relative capacity (CINC) 
mlogit  defend_silent_shame  agree_average chinatradegdp  v2x_polyarchy  muslim_ratio turk relativegdp humanrights logpop   if COWcode!=710, baseoutcome(0) vce(robust)

*VIF Scores
reg defend_silent_shame   agree_average chinatradegdp  v2x_polyarchy  muslim_ratio turk relativecinc humanrights 
vif

reg defend_silent_shame   agree_average chinatradegdp  v2x_polyarchy  muslim_ratio turk relativecinc humanrights logpop loggdp
vif


*Panel Data Analysis

use "ZZ_PanelData"
xtset COWcode year
mlogit  position  agree chinatradegdp v2x_polyarchy humanrights i.turk muslim_ratio relativecinc loggdp logpop  if COWcode!=710, baseoutcome(0) vce(robust)










